package cn.qf.shop.service.impl;

import cn.qf.shop.mapper.CarMapper;
import cn.qf.shop.pojo.entity.Car;
import cn.qf.shop.pojo.qo.CarQo;
import cn.qf.shop.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper carMapper;
    @Override
    public List<Car> selectAll() {
        List<Car> cars = carMapper.selectAll();
        return cars;
    }

    @Override
    public List<Car> selectByKeyWord(CarQo carQo) {
        List<Car> cars = carMapper.selectByKeyWord(carQo);
        return cars;
    }

    @Override
    public int updateByCarIds(Set<Integer> carIds) {
        int i = carMapper.updateByCarIds(carIds);
        return i;
    }

    @Override
    public int AddCar(CarQo carQo) {
        int i = carMapper.AddCar(carQo);
        return i;
    }

    @Override
    public int updateByOnclick(CarQo carQo) {
        int i = carMapper.updateByOnclick(carQo);
        return i;
    }

    @Override
    public int updateByCarId(CarQo carQoId) {
        int i = carMapper.updateByCarId(carQoId);
        return i;
    }
}
